//
//  EvaluateOrderCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/9/8.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "EvaluateOrderCell.h"

@implementation EvaluateOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:6];
    });
}

- (void)fillCellWithModel:(OrderGoodsModel *)model {
    
    self.skuLab.hidden = YES;
    self.countLab.hidden = YES;
    
    //商品类型（1：套餐，2：婚品，3：酒宴）
//    switch (model.ogGoodsType) {
//        case 1:{
//
//            self.priceLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.ogPayPrice]];
//
//        } break;
//        case 2:{
//
//            self.skuLab.hidden = NO;
//            self.countLab.hidden = NO;
//
//            self.priceLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.ogPayPrice]];
//            self.countLab.text = [NSString stringWithFormat:@"%ld",model.ogGoodsNum];
//
//        } break;
//        case 3:{
//
//            self.priceLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.ogPayPrice]];
//
//        } break;
//        default:
//            break;
//    }
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.goodsImg] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.ogGoodsName;
}

- (void)fillCellWithSubscribeModel:(CommonSubscribeModel *)model {
    self.topLine.hidden = YES;
    NSString *url = [TT_OSSManager reSourceUrl:model.seller.logoUrl type:BA_resizeType_plus];
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.seller.sellerName;
}

- (void)fillCellWithSubscribeRingModel:(CommonSubscribeRingModel *)model {
    self.topLine.hidden = YES;
    NSString *url = [TT_OSSManager reSourceUrl:model.logoUrl type:BA_resizeType_plus];
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.sellerName;
}
@end
